Ingemar Ragnemalm's Window Definition package, version 1.2
______
Ingis WDEF is sample code to a WDEF, but actually, it is slightly more than that. It is a package that is designed to make WDEF design easier. The approach is to provide a kind of skeleton, where the reuseable code is separated from your custom code. The reuseable code calls the custom code through a set of predefined procedures.
IngisWDEF was used for creating the hexagonal window in Hexmines 2.0, as well as the round window in the Pascal version of "NewWatch" (a source code demo of an analog clock).
The package consists of source code files, projects and demo programs:
• Core files: IngisWDEF.p, CustomStubs.p (Empty) and IngisWDEFUtils.p.
- IngisWDEF.p: Main unit. Most reuseable code is here. It calls all custom routines as appropriate.
- CustomStubs.p (Empty): This is the empty stubs file, with a bunch of empty procedures for you to fill in as you like them.
- IngisWDEFUtils.p: A set of procedures that you might want to call from the custom routines. Includes check for ColorQD, some standard colors and some standard items (close, zoom and grow icons).
• Demos: SimpleCustomStubs.p, VariantCustomStubs.p and CustomStubsCirc.p. These are copies of CustomStubs.p with a few procedures filled in, in order to make each a complete, working - though simple - WDEF.
- SimpleCustomStubs.p: Implements a rounded-rect window with a drag bar and close box.
- VariantCustomStubs.p: Implements a window with drag, with a shape that is determined from the varCode.
- CustomStubsCirc.p: Implements a circular window.
For the demos, there are project files, the skeleton program Skel 3.0iw for trying the WDEFs in, and copies of the latter with WDEFs installed (Skel/Simple, Skel/Circ…).
NOTE: Skel 3.0iw does NOT include any WDEF. It is used as resource file for the demos, not intended to run as it is. If you run it, it will just show a standard window.
VERSION 1.1 CHANGES:
Version 1.1 supports not only Think Pascal but also Metrowerks Pascal (68k only). To do this, I had to make the following changes:
• Add project files for MWP for each demo.
• The "CustomStubs" files for the demo are all named "CustomStubs.p". This is less informative and gives a risk to mix up files. However, it was necessary since Metrowerks Pascal demands that file names and unit names match.
• A bunch of conditional compilation switches were added. The demo code gets longer by this, but you can always delete the parts that don't apply to your development system.
Another change is that Skel has slightly more memory. The "variant" demo in 1.0 behaved strangely on PowerMacs with VM off, due to lack of memory. This was not a problem with IngisWDEF, just memory shortage.
VERSION 1.2 CHANGES:
Updated for CodeWarrior 9.
VERSION 1.3 CHANGES:
Fixed a bug that caused problems for some WDEFs when hiding the application.
Adds support for user defined globals.
_____
Limitations:
===========
The current version of IngisWDEF does not have a "deviceloop", which means that it may not produce perfect results when its window are placed across screen borders.